from appium import webdriver
from appium.webdriver.common.appiumby import By
from time import sleep
from time import sleep
from appium import webdriver
from appium.webdriver.common.appiumby import By

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '7'
desired_caps['devices'] = '127.0.0.1:62001'
desired_caps['app'] = r'D:apk\mymoney.apk'
desired_caps['appPackage'] = 'com.mymoney'
desired_caps['appActivity'] = 'com.mymoney.biz.splash.SplashScreenActivity'
desired_caps['noResert'] = False
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
# 隐式等待
driver.implicitly_wait(10)
# 点击同意
try:
    ele = driver.find_element(By.ID, 'com.mymoney:id/sui_dialog_positive_btn_style1')
except Exception as e:
    print(e)
else:
    ele.click()
# 选账本
try:
    ele = driver.find_element(By.ID, 'com.mymoney:id/select_template_btn')
except Exception as e:
    print(e)
else:
    ele.click()
# 点击跳过
try:
    ele = driver.find_element(By.ID, 'com.mymoney:id/bottom_skip_tv')
except Exception as e:
    print(e)
else:
    ele.click()
